// get the next number
function step(num) {
  if (num === 1) return 1;
  return num & 1 ? (num * 3 + 1) >> 1 : num >> 1
}

// Show Step in Console Only
function checkSteps(num) {
  let cnt = 0;
  while (num >= 2) {
    console.log(num, num.toString(3));
    num = num & 1 ? (num * 3 + 1) >> 1 : num >> 1;
    cnt++;
  }
  console.log('cnt:', cnt);
}